package com.huobao.yunying.adapters;

import com.huobao.yunying.activitys.Act_Tuikuan_detail;
import com.huobao.yunying.entity.TuihuanHuoList;
import com.huobao.yunying.utils.ImageUtils;
import com.huobao.zhangying.R;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import joanzapata.android.BaseAdapterHelper;
import joanzapata.android.QuickAdapter;

public class TuihuoAdapter extends QuickAdapter<TuihuanHuoList>{

	public TuihuoAdapter(Context context) {
		super(context, R.layout.item_dingdan_tuihuo_manager);
	}

	@Override
	protected void convert(BaseAdapterHelper arg0, final TuihuanHuoList arg1) {
		arg0.setText(R.id.tv_storename, "订单号："+arg1.order_sn);
		TextView tv_status = arg0.getView(R.id.tv_status);
		ImageView imgView = arg0.getView(R.id.imgView);
		TextView tv_goods_name = arg0.getView(R.id.tv_goods_name);
		TextView tv_price = arg0.getView(R.id.tv_price);
		TextView tv_del = arg0.getView(R.id.tv_del);
		TextView tv_fukuan = arg0.getView(R.id.tv_fukuan);
		tv_fukuan.setBackgroundColor(Color.TRANSPARENT);
		tv_del.setBackgroundColor(Color.TRANSPARENT);
		tv_del.setTextColor(Color.BLACK);
		tv_del.setText("实付款："+arg1.total_fee);
		tv_fukuan.setTextColor(Color.BLACK);
		tv_fukuan.setText("退款时间："+arg1.created);
		
		ImageUtils.loadimg(imgView, arg1.default_image);
		tv_goods_name.setText(arg1.goods_name);
		tv_price.setVisibility(View.GONE);
		
		tv_status.setText("状态："+arg1.status_text);
		arg0.getView().setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View view) {
				Intent intent = new Intent(context, Act_Tuikuan_detail.class);
				intent.putExtra("id", arg1.refund_id);
				context.startActivity(intent);
			}
		});
	}

}
